<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath()+"/";
%>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="<%=basePath %>css/list.css">
		<link href="<%=basePath %>css/H-ui.min.css" rel="stylesheet" type="text/css" />
		<script src="<%=basePath %>js/jquery.min.js"></script>
		<link rel="stylesheet" href="<%=basePath %>lib/icheck/icheck.css">
        <script src="<%=basePath %>lib/My97DatePicker/WdatePicker.js"></script>
        <script src="<%=basePath %>lib/icheck/jquery.icheck.min.js"></script>
		<script src="<%=basePath %>js/H-ui.js"></script>
		<script src="${pageContext.request.contextPath}/lib/bootstrap-modal/2.2.4/bootstrap-modalmanager.js"></script>
        <script src="${pageContext.request.contextPath}/lib/bootstrap-modal/2.2.4/bootstrap-modal.js"></script>
        <style>
        	.input-text, .textarea{
        		width: auto;
        	}
        </style>
        <script>
      //导出订单信息
        function exportExcel() {
        	var  tradetype = $("input[name='tradetype']").val();
        	var  tradestatus = $("input[name='tradestatus']").val();
        	var  tradeBeginTime = $("input[name='tradeBeginTime']").val();
        	var  tradeEndTime = $("input[name='tradeEndTime']").val();
        		
        	var params = "tradetype="+tradetype
        				+"&tradestatus="+tradestatus
        				+"&tradeBeginTime="+tradeBeginTime
        				+"&tradeEndTime="+tradeEndTime;
        	var url = "<%=basePath %>goodsBill/exportExcel?"+params ;
        	window.location.href = url;
      }
      
      
        </script>
        
       
    </head>
    <body>
    	<div class="connect_wrap">
    	
    	<ul id="Huifold1" class="Huifold">
		  <li class="item">
		    <h4>查询条件<b>+</b></h4>
		    <div class="info" style="border: 1px solid #E8EAEA;padding-bottom: 18px;">
		    	<form action="<%=basePath %>goodsBill/goodsBillList" method="get">
		    		<div class="row">
			    		<div style="float: left;">
			    			<div class="input-group">
							  <span class="input-group-addon">交易类型: </span>
							  <input type="text" class="input-text size-S" name="tradetype"   value="${page.conMap.tradetype}"/>
							  <span class="input-group-addon">交易状态: </span>
							  <input type="text" class="input-text size-S" name="tradestatus"   value="${page.conMap.tradestatus}"/>
							  <span class="input-group-addon">交易时间 : </span> 
							  <input type="text" class="input-text size-S Wdate"  placeholder="开始时间"
									 name="tradeBeginTime" value="${page.conMap.tradeBeginTime }"
									 onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
										- 
							  <input type="text" class="input-text size-S Wdate" placeholder="结束时间"
									 name="tradeEndTime" value="${page.conMap.tradeEndTime }"
									 onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"><br><br>
							   

							</div>
			    		</div>
			    	</div>
			    	<br/><br/>
			    	<div class="row">
			    		<div class="col-sm-12">
			    			<input type="button" value="账单导出" class="btn btn-primary "	onClick="exportExcel()" 
			    				style="float: right;margin-left: 10px;" id="export"/>  
			    			<input type="submit" value="查询" class="btn btn-primary " style="float: right;"/>
 			    		</div>
			    	</div>
			    	<br/>
		    	</form>
		    </div>
		  </li>
		</ul>
    	<br/>
    	<!-- 遍历列表数据 -->
    	<table class="table table-border table-bordered table-striped table-hover">
    		<tr style="font-weight: bold;">
    			<!-- <td>ID</td> -->
    			<td>序号</td>
    			<td>交易时间</td>
    			<td>微信订单号</td>
    			<td>商户订单号</td>  		
    			<td>交易类型</td>
    			<td>交易状态</td>
    			<td>总金额</td>
    			<td>微信退款单号</td>
    			<td>商户退款单号</td>
    			<td>退款金额</td> 
    			<td>退款类型</td> 
    			<td>退款状态</td> 
    			<td>商品名称</td> 
    			 
    			<!-- <td>操作</td>   -->
    			 
    		</tr>
    		<c:if test="${not empty page.results}">
    			<c:forEach items="${page.results}" var="result" varStatus="vs">
    			<tr>
    				<td >${(page.actulPageNo -1)*15+vs.count} </td>
	                <td>${result.tradetime}</td>
	                <td>${result.wxorder}</td>
	                <td>${result.bzorder}</td>
	                <td>${result.tradetype}</td>
	                <td>${result.tradestatus}</td>
	                <td>${result.totalmoney}</td>
	                <td>${result.wxrefund}</td>
	                <td>${result.bzrefund}</td>
    				<td>${result.refundmoney}</td>
    			    <td>${result.refundtype}</td>
    				<td>${result.refundstatus}</td>
    			    <td>${result.productname}</td>
	                  
	    		</tr>
    		</c:forEach>
    	</c:if>
		</table>
    	</div>
    	
    
    	
        <!-- 分页 -->
    	 <div>
	 	<c:if test="${page.totalPageNo > 1 }">
        	<div class="fanye_div">
	            <ul class="fanye">
	                <li>共  ${page.totalCount }  条</li>
	                <li><a href='<%=basePath %>${page.url}?pageNo=1${page.params}'>首页</a></li>
	                  <c:if test="${page.actulPageNo > 1 }">
	                	<li><a href='<%=basePath %>${page.url}?pageNo=${page.actulPageNo -1 }${page.params}'>上一页</a></li>
	                </c:if>
	                <c:forEach var="pno" items="${page.showNums }">
						<c:choose>
							<c:when test="${pno == page.actulPageNo}">
								<li class="current"><a href='<%=basePath %>${page.url}?pageNo=${pno }${page.params}'>${pno }</a></li>			
							</c:when>
							<c:otherwise>
								<li><a href='<%=basePath %>${page.url}?pageNo=${pno  }${page.params}'>${pno }</a></li>		
							</c:otherwise>
						</c:choose>
	                </c:forEach>
					<c:if test="${page.actulPageNo  < page.totalPageNo }">
	                	<li><a href='<%=basePath %>${page.url}?pageNo=${page.actulPageNo+1 }${page.params}'>下一页</a></li>
	                </c:if>
	                <li><a href='<%=basePath %>${page.url}?pageNo=${page.totalPageNo }${page.params}'>尾页</a></li>
	            </ul>
	        </div>
        </c:if>
     </div>
    </body>
    
    <script>
    $(function(){
    	$.Huifold("#Huifold1 .item h4","#Huifold1 .item .info","fast",1,"click");
    	
    	$('.orderByRadio').iCheck({
    		checkboxClass: 'icheckbox-blue',
    		radioClass: 'iradio-blue',
    		increaseArea: '20%'
    	});
    	
    	$("#Huifold1 .item h4").click();
    	 
    	
    });
    </script>
</html>